<?php

require_once "Common/database.php";
require_once "Common/values.php";

   $result = mysql_query("SELECT * FROM tblUsers WHERE Name='$user'");
   $row = mysql_fetch_array($result);
if($row[s]>1)
{
echo '<p><h3>Users</h3>';
#echo '<FORM action="system/updateuser.php" method="POST">';
echo '<p><table width=100% border=1>';
echo '<tr><td>Username</td><td>Display name</td><td>Default</td><td>Email</td><td>Password</td><td>H</td><td>P</td><td>KB</td><td>Links</td><td>Events<br> Add</td><td>IP</td><td>S</td><td>I</td><td>Delete</td></tr>';

$result = mysql_query("SELECT * FROM tblUsers WHERE Username!='systemadmin'");
while($row = mysql_fetch_array($result))
  {
echo '<FORM action="system/updateuser.php" method="POST">';
echo '<tr><td><input type=text name=username value="'.$row['Username'].'"></td><td><input type=text name=name value="'.$row['Name'].'"></td><td><input type="text" name="default" value="'.$row['Default'].'"></td><td><input type="text" name="email" value="'.$row[Email].'"></td><td><input type=password name=password ';
if($ldap=='true')
{
    echo 'Disabled';
}
echo '><td><input type=text size=1 name=h value="'.$row[h].'"></td><td><input type=text name=p size=1 value="'.$row[p].'" ></td><td><input type=text size=1 name=kb value="'.$row[kb].'"></td><td><input type=text name=a size=1 value="'.$row[a].'"></td><td><input type=text size=1 name=l value="'.$row[l].'" ></td><td><input type=text name=ip size=1 value="'.$row[ip].'"></td><td><input type=text size=1 name=s value="'.$row[s].'"></td><td><input type=text name=i size=1 value="'.$row[i].'"></td><td><input type="checkbox" name="delete" value="checked"></td><td><INPUT type="submit" value="Update"></td></tr></FORM>';
  }
echo '</table>';
echo '<a href="index.php?m=s&p=sadduser">Add</a>';
#echo '<INPUT type="submit" value="Submit">';
}
else
{
    echo '<h3>Access Denided</h3>';
}
?>